package com.y.fund.aacore.abs;


import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.y.fund.aacore.able.Idable;
import com.y.fund.aacore.able.TimeCreateable;
import com.y.fund.aacore.dao.IdGenerator4Hibernate;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.AccessMode;
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.Version;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@MappedSuperclass
@GenericGenerator(name="assignGenerator", type =IdGenerator4Hibernate.class)
public abstract class IdObj implements Idable, TimeCreateable {

	/** EasyExcel使用：导出时忽略该字段  */
	@Id
	@Column(name = "id", updatable=false, length=64)
	@GeneratedValue(generator="assignGenerator")
	@Schema(title = "主键")
	protected String id;
	
	@Version
	@JsonIgnore
    @Column(name="d_version")
	@Schema(title = "数据库版本", hidden = true)
	protected Integer version;

	@Column(name = "create_time", length=25, updatable=false)
	@Schema(title = "创建时间", accessMode = AccessMode.READ_ONLY)
	protected String createTime;

}
